package com.cyl.XmlDemo.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.config.annotation.EnableWebSocket;
import org.springframework.web.socket.config.annotation.WebSocketConfigurer;
import org.springframework.web.socket.config.annotation.WebSocketHandlerRegistry;

import com.cyl.XmlDemo.service.MarcoHandler;

/*@Configuration
@EnableWebSocket*/
public class WebSocketConfig implements WebSocketConfigurer {

	public void registerWebSocketHandlers(WebSocketHandlerRegistry registry) {
		registry.addHandler(handler(), "/marco").withSockJS();
	}
	
	@Bean
	public MarcoHandler handler(){
		return new MarcoHandler();
	}
	
}
